<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>注册Hbcoin</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<script src="https://cdn.bootcss.com/vue/2.6.10/vue.min.js"></script>
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<style>
.reg-name{width:100%;color:#1C384E;text-align:center;padding:20px 0;font-size:20px;font-weight:bold;}
.form-item{width:90%;margin:auto;padding-top:40px;}
.form-item input{padding-bottom:10px;text-indent:10px;width:100%;border:none;border-bottom:1px solid #ccc;border-bottom-right-radius:2px ;border-bottom-left-radius:2px ;}
input:focus{ outline:none } 
.add-btn{width:90%;margin:auto;height:50px;line-height:50px;text-align:center;color:#fff;background:#409EFF;margin-top:20px;border-radius:3px;}
</style>
</head>
<body>
<div id="box">
	<div class="reg-name">注册Hbcoin</div>
	<div class="form-item">
		<input type="text" placeholder="请输入手机号码" v-model="form.mobile">
	</div>
	<div class="form-item">
		<input placeholder="请输入推荐人编号" v-model = "form.tjuser" readonly="readonly">
	</div>
	<div class="form-item">
		<input placeholder="请输入登录密码" v-model = "form.password" type="password">
	</div>
	<div class="form-item">
		<input placeholder="请确认登录密码" v-model="re_pwd" type="password">
	</div>
	<div class="form-item">
		<input placeholder="请输入交易密码" v-model = "form.pay_pwd" type="password">
	</div>
	<div class="form-item">
		<input placeholder="请确认交易密码" v-model="re_pay" type="password">
	</div>
	<div class="add-btn" @click="submit();">立即注册</div>
</div>
</body>
<script>
new Vue({
	el : '#box',
	data:{
		form : {
			mobile : '',
			password : '',
			pay_pwd : '',
			tjuser : '{$tjuser}'
		},
		re_pwd :'',
		re_pay : '',
	},
	mounted:function(){},
	methods:{
		submit(){
			if(!this.form.mobile)return alert('请输入手机号');
			if(!this.form.tjuser)return alert('请输入推荐人编号');
			if(!this.form.password)return alert('请输入登录密码');
			if(!this.re_pwd) return alert('请确认登录密码');
			if(!this.form.pay_pwd)return alert('请输入交易密码');
			if(!this.re_pay)return alert('请确认交易密码');
			if(this.form.password != this.re_pwd)return alert('两次输入登录密码不一致');
			if(this.form.pay_pwd != this.re_pay)return alert('两次输入交易密码不一致');
			var that = this;
			$.post("{:url('login/reg_do')}",this.form,function(res){
				res = JSON.parse(res);
				alert(res.msg);
				if(res.code) {
					
				}
			});
		}
	}
});
</script>
</html>